package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IAdvancedTaskModel;
import com.wgts.wgts.mvp.presenter.IAdvancedTaskPersenter;
import com.wgts.wgts.mvp.view.IAdvancedTaskView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.ShopKeepTaskEntity;

import java.util.List;

public class AdvancedTaskPersenter implements IAdvancedTaskPersenter {

    private IAdvancedTaskModel model;

    private IAdvancedTaskView view;


    public AdvancedTaskPersenter(IAdvancedTaskModel model, IAdvancedTaskView view) {
        this.model = model;
        this.view = view;
    }


    @Override
    public void shopKeepTask() {
        model.shopKeepTask(new HttpResultSubscriber<List<ShopKeepTaskEntity>>() {
            @Override
            public void onSuccess(List<ShopKeepTaskEntity> shopKeepTaskEntities) {
                view.taskResult(shopKeepTaskEntities);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
